Skip to content

Conversation

@aarmoa
Copy link
Collaborator

@aarmoa aarmoa commented Dec 23, 2025

  • Adds support for the new Chainlink Data Streams oracle messages

Solves C-655

Summary by CodeRabbit

  • New Features

    • Added symbol and oracle_type filtering parameters for oracle list queries
    • Added Chainlink Data Streams oracle relay functionality
    • Added IAM policy operations support
  • Improvements

    • Enhanced market data with funding tracking fields (cumulative and effective funding entries)
    • Updated namespace configuration with new wasm_hook and evm_hook parameters
    • Corrected market position query endpoint paths
  • Updates

    • Updated OFAC compliance address list
    • Updated dependencies to latest versions
    • Version bumped to 1.13.0-rc1

✏️ Tip: You can customize this high-level summary in your review settings.

…71. Includes support for the new Chainlink oracle messages.
@aarmoa aarmoa requested a review from Copilot December 23, 2025 16:01
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 23, 2025

Walkthrough

This PR updates the injective-indexer repository version, regenerates protobuf files with modified descriptor layouts and new messages, renames the contract_hook parameter to wasm_hook and adds evm_hook support across permissions-related message composers, and enables optional filtering parameters for oracle list queries. Version bumped to 1.13.0-rc1.

Changes

Cohort / File(s) Summary
Configuration & Version Updates
Makefile, buf.gen.yaml, pyproject.toml
Updated injective-indexer tag (v1.17.16 → v1.17.71), adjusted git_repo tags for cometbft and cosmos-sdk, switched injective-core to c-655 branch, bumped package version to 1.13.0-rc1.
Oracle Query Filtering
pyinjective/async_client.py, pyinjective/indexer_client.py, pyinjective/client/indexer/grpc/indexer_grpc_oracle_api.py, examples/exchange_client/oracle_rpc/3_OracleList.py, tests/client/indexer/grpc/test_indexer_grpc_oracle_api.py
Added optional symbol and oracle_type parameters to fetch_oracle_list() methods across client layers to enable filtering; example now demonstrates parameterized query usage.
Namespace Hooks Refactor
pyinjective/composer.py, pyinjective/composer_v2.py, examples/chain_client/permissions/1_MsgCreateNamespace.py, examples/chain_client/permissions/2_MsgUpdateNamespace.py, tests/test_composer.py, tests/test_composer_v2.py
Renamed contract_hookwasm_hook and added new evm_hook parameter in msg_create_namespace() and msg_update_namespace() across composer modules and examples; updated tests to reflect signature changes.
Permissions Protobuf Definitions
pyinjective/proto/injective/permissions/v1beta1/{params_pb2,permissions_pb2,tx_pb2}.py
Regenerated descriptors: Params.wasm_hook_query_max_gascontract_hook_max_gas, Namespace.contract_hookwasm_hook, adjusted descriptor offsets and build logic.
Oracle Protobuf Definitions
pyinjective/proto/injective/oracle/v1beta1/{events_pb2,genesis_pb2,oracle_pb2,query_pb2,query_pb2_grpc,tx_pb2,tx_pb2_grpc}.py
Added Chainlink data streams support: new ChainlinkDataStreamsPriceState message type, QueryChainlinkDataStreamsPriceStatesRequest/Response, RelayChainlinkPrices RPC method; regenerated descriptor offsets and field layouts.
Exchange Protobuf Descriptors
pyinjective/proto/injective/exchange/v{1beta1,2}/{exchange_pb2,query_pb2,market_pb2,proposal_pb2}.py, pyinjective/proto/exchange/{event_provider_api_pb2,injective_archiver_rpc_pb2,injective_auction_rpc_pb2,injective_derivative_exchange_rpc_pb2,injective_megavault_rpc_pb2,injective_oracle_rpc_pb2,injective_portfolio_rpc_pb2}.py
Regenerated descriptor metadata with updated serialized boundary offsets; added fields has_disabled_minimal_protocol_fee to market messages and cumulative price fields to ExpiryFuturesMarketInfo; added AuctionAccountStatus RPC method.
Google API Protobuf Modules
pyinjective/proto/google/{api/routing_pb2,api/routing_pb2_grpc,iam/v1/{iam_policy_pb2,iam_policy_pb2_grpc,options_pb2,options_pb2_grpc,policy_pb2,policy_pb2_grpc}}.py
Added new generated protobuf modules for Google API routing and IAM policy; includes service stubs, servicer interfaces, and message definitions for SetIamPolicy, GetIamPolicy, TestIamPermissions RPCs.
Additional Data Maintenance
pyinjective/ofac.json, pyinjective/orderhash.py
Added three new OFAC-sanctioned addresses; refactored OrderInfo, SpotOrder, and DerivativeOrder from EIP712Type to Pydantic BaseModel with centralized EIP712Domain.
Exchange & Derivative Tests
tests/client/chain/grpc/test_chain_grpc_exchange_v2_api.py, tests/client/chain/grpc/test_chain_grpc_permissions_api.py, tests/client/indexer/grpc/{test_indexer_grpc_derivative_api,test_indexer_grpc_portfolio_api,test_indexer_grpc_oracle_api}.py, tests/client/indexer/stream_grpc/test_indexer_grpc_derivative_stream.py
Updated test fixtures to include new protobuf fields (has_disabled_minimal_protocol_fee, cumulative funding entries); updated permissions tests to use wasm_hook/evm_hook instead of contract_hook; added oracle filtering parameter tests.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~55 minutes

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 23.19% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title '[C-655] add chainlink data streams oracle' accurately describes the main change in the changeset - adding support for Chainlink Data Streams oracle functionality.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch c-655/add_chainlink_data_streams_oracle

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for Chainlink Data Streams oracle integration to the Injective Python SDK. The changes primarily update protobuf-generated files to include new Chainlink Data Streams-related messages and fields, along with renaming fields in the permissions module from contract_hook to wasm_hook and adding evm_hook support.

Key Changes:

  • Added Chainlink Data Streams oracle price state and relay message support
  • Renamed contract_hook to wasm_hook and added evm_hook in permissions module
  • Added new position fields (cumulative_funding_entry, effective_cumulative_funding_entry)
  • Added has_disabled_minimal_protocol_fee field to market structures
  • Updated version to 1.13.0-rc1

Reviewed changes

Copilot reviewed 52 out of 53 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pyproject.toml Version bump to 1.13.0-rc1
pyinjective/proto/injective/oracle/v1beta1/*.py Added Chainlink Data Streams oracle support with new message types and query endpoints
pyinjective/proto/injective/permissions/v1beta1/*.py Renamed contract_hook to wasm_hook, added evm_hook field
pyinjective/proto/injective/exchange/v2/*.py Added has_disabled_minimal_protocol_fee field to market proposals and queries
tests/*.py Updated tests to use new wasm_hook/evm_hook naming and added new position fields
pyinjective/proto/google/iam/v1/*.py Added new Google IAM policy proto files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedclick@​8.3.0 ⏵ 8.3.196 +1100100100100
Updatedcertifi@​2025.10.5 ⏵ 2025.11.1210010010010070
Addedcoincurve@​20.0.0100100100100100
Addedcchecksum@​0.3.5100100100100100
Updatedcfgv@​3.4.0 ⏵ 3.5.0100 +1100100100100

View full report

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
pyinjective/composer_v2.py (2)

249-252: Fix GRPC response map for MsgRelayProviderPricesResponse.

GRPC_RESPONSE_TYPE_TO_CLASS_MAP maps the type URL for MsgRelayProviderPricesResponse to the request class MsgRelayProviderPrices instead of the corresponding response class. This will cause Composer.MsgResponses / unpack_msg_exec_response to deserialize those responses into the wrong message type.

Proposed fix
-    "/injective.oracle.v1beta1.MsgRelayProviderPricesResponse":
-        injective_oracle_tx_pb.MsgRelayProviderPrices,
+    "/injective.oracle.v1beta1.MsgRelayProviderPricesResponse":
+        injective_oracle_tx_pb.MsgRelayProviderPricesResponse,

1579-1584: Return type annotation does not match actual return value.

chain_stream_oracle_price_filter is annotated to return PositionsFilter but actually returns OraclePriceFilter. This will confuse type checkers and readers.

Proposed fix
-    def chain_stream_oracle_price_filter(
-        self,
-        symbols: Optional[List[str]] = None,
-    ) -> chain_stream_v2_query.PositionsFilter:
+    def chain_stream_oracle_price_filter(
+        self,
+        symbols: Optional[List[str]] = None,
+    ) -> chain_stream_v2_query.OraclePriceFilter:
🧹 Nitpick comments (1)
pyinjective/client/indexer/grpc/indexer_grpc_oracle_api.py (1)

14-25: OracleList RPC wiring is correct; consider tidying stub assignment

fetch_oracle_list now correctly builds an OracleListRequest with symbol and oracle_type and passes it to _stub.OracleList via _execute_call, consistent with the other RPC helpers. As a tiny cleanup while you’re here, you can drop the redundant self._stub = self._stub = ... assignment in __init__ and just assign once.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8645426 and 82b8ddb.

⛔ Files ignored due to path filters (1)
  • poetry.lock is excluded by !**/*.lock
📒 Files selected for processing (52)
  • Makefile
  • buf.gen.yaml
  • examples/chain_client/permissions/1_MsgCreateNamespace.py
  • examples/chain_client/permissions/2_MsgUpdateNamespace.py
  • examples/exchange_client/oracle_rpc/3_OracleList.py
  • pyinjective/async_client.py
  • pyinjective/client/indexer/grpc/indexer_grpc_oracle_api.py
  • pyinjective/composer.py
  • pyinjective/composer_v2.py
  • pyinjective/indexer_client.py
  • pyinjective/ofac.json
  • pyinjective/orderhash.py
  • pyinjective/proto/exchange/event_provider_api_pb2.py
  • pyinjective/proto/exchange/injective_archiver_rpc_pb2.py
  • pyinjective/proto/exchange/injective_auction_rpc_pb2.py
  • pyinjective/proto/exchange/injective_auction_rpc_pb2_grpc.py
  • pyinjective/proto/exchange/injective_derivative_exchange_rpc_pb2.py
  • pyinjective/proto/exchange/injective_megavault_rpc_pb2.py
  • pyinjective/proto/exchange/injective_oracle_rpc_pb2.py
  • pyinjective/proto/exchange/injective_portfolio_rpc_pb2.py
  • pyinjective/proto/google/api/routing_pb2.py
  • pyinjective/proto/google/api/routing_pb2_grpc.py
  • pyinjective/proto/google/iam/v1/iam_policy_pb2.py
  • pyinjective/proto/google/iam/v1/iam_policy_pb2_grpc.py
  • pyinjective/proto/google/iam/v1/options_pb2.py
  • pyinjective/proto/google/iam/v1/options_pb2_grpc.py
  • pyinjective/proto/google/iam/v1/policy_pb2.py
  • pyinjective/proto/google/iam/v1/policy_pb2_grpc.py
  • pyinjective/proto/injective/exchange/v1beta1/exchange_pb2.py
  • pyinjective/proto/injective/exchange/v1beta1/query_pb2.py
  • pyinjective/proto/injective/exchange/v2/market_pb2.py
  • pyinjective/proto/injective/exchange/v2/proposal_pb2.py
  • pyinjective/proto/injective/exchange/v2/query_pb2.py
  • pyinjective/proto/injective/oracle/v1beta1/events_pb2.py
  • pyinjective/proto/injective/oracle/v1beta1/genesis_pb2.py
  • pyinjective/proto/injective/oracle/v1beta1/oracle_pb2.py
  • pyinjective/proto/injective/oracle/v1beta1/query_pb2.py
  • pyinjective/proto/injective/oracle/v1beta1/query_pb2_grpc.py
  • pyinjective/proto/injective/oracle/v1beta1/tx_pb2.py
  • pyinjective/proto/injective/oracle/v1beta1/tx_pb2_grpc.py
  • pyinjective/proto/injective/permissions/v1beta1/params_pb2.py
  • pyinjective/proto/injective/permissions/v1beta1/permissions_pb2.py
  • pyinjective/proto/injective/permissions/v1beta1/tx_pb2.py
  • pyproject.toml
  • tests/client/chain/grpc/test_chain_grpc_exchange_v2_api.py
  • tests/client/chain/grpc/test_chain_grpc_permissions_api.py
  • tests/client/indexer/grpc/test_indexer_grpc_derivative_api.py
  • tests/client/indexer/grpc/test_indexer_grpc_oracle_api.py
  • tests/client/indexer/grpc/test_indexer_grpc_portfolio_api.py
  • tests/client/indexer/stream_grpc/test_indexer_grpc_derivative_stream.py
  • tests/test_composer.py
  • tests/test_composer_v2.py
🧰 Additional context used
🧬 Code graph analysis (7)
pyinjective/indexer_client.py (2)
pyinjective/async_client.py (1)
  • fetch_oracle_list (1297-1300)
pyinjective/client/indexer/grpc/indexer_grpc_oracle_api.py (1)
  • fetch_oracle_list (18-27)
tests/client/indexer/grpc/test_indexer_grpc_oracle_api.py (3)
pyinjective/async_client.py (1)
  • fetch_oracle_list (1297-1300)
pyinjective/client/indexer/grpc/indexer_grpc_oracle_api.py (1)
  • fetch_oracle_list (18-27)
pyinjective/indexer_client.py (1)
  • fetch_oracle_list (662-665)
pyinjective/async_client.py (2)
pyinjective/client/indexer/grpc/indexer_grpc_oracle_api.py (1)
  • fetch_oracle_list (18-27)
pyinjective/indexer_client.py (1)
  • fetch_oracle_list (662-665)
pyinjective/proto/google/iam/v1/iam_policy_pb2_grpc.py (1)
pyinjective/core/network.py (1)
  • metadata (20-25)
examples/exchange_client/oracle_rpc/3_OracleList.py (3)
pyinjective/async_client.py (1)
  • fetch_oracle_list (1297-1300)
pyinjective/client/indexer/grpc/indexer_grpc_oracle_api.py (1)
  • fetch_oracle_list (18-27)
pyinjective/indexer_client.py (1)
  • fetch_oracle_list (662-665)
pyinjective/proto/injective/oracle/v1beta1/tx_pb2_grpc.py (1)
pyinjective/core/network.py (1)
  • metadata (20-25)
pyinjective/client/indexer/grpc/indexer_grpc_oracle_api.py (2)
pyinjective/async_client.py (1)
  • fetch_oracle_list (1297-1300)
pyinjective/indexer_client.py (1)
  • fetch_oracle_list (662-665)
🪛 Ruff (0.14.10)
pyinjective/proto/injective/oracle/v1beta1/query_pb2_grpc.py

184-184: Unused method argument: request

(ARG002)

pyinjective/proto/exchange/injective_auction_rpc_pb2_grpc.py

104-104: Unused method argument: request

(ARG002)

pyinjective/proto/google/iam/v1/iam_policy_pb2_grpc.py

88-88: Unused method argument: request

(ARG002)


98-98: Unused method argument: request

(ARG002)


107-107: Unused method argument: request

(ARG002)

pyinjective/proto/injective/oracle/v1beta1/tx_pb2_grpc.py

122-122: Unused method argument: request

(ARG002)

🔇 Additional comments (60)
pyinjective/proto/injective/oracle/v1beta1/tx_pb2.py (1)

48-49: Auto-generated protobuf code looks correct.

The new MsgRelayChainlinkPrices and MsgRelayChainlinkPricesResponse descriptors are properly registered with correct serialized options and sequential, non-overlapping byte ranges. The pattern matches other oracle relay messages (e.g., MsgRelayPythPrices).

Also applies to: 86-95

pyinjective/proto/injective/oracle/v1beta1/tx_pb2_grpc.py (4)

53-57: LGTM!

The client stub correctly registers the new RelayChainlinkPrices RPC with appropriate request serializer and response deserializer, following the established pattern of other relay methods.


122-128: Servicer interface correctly defined; static analysis hint is a false positive.

The request argument is part of the gRPC servicer method signature contract. All other servicer methods in this file follow the identical pattern where the base implementation raises NotImplementedError. The unused argument warning can be safely ignored for interface/base class methods.


175-179: Server registration correctly wired.

The method handler uses appropriate deserializer (MsgRelayChainlinkPrices.FromString) for requests and serializer (MsgRelayChainlinkPricesResponse.SerializeToString) for responses, consistent with the other relay methods.


386-411: Experimental API method correctly added.

The static RelayChainlinkPrices method follows the same pattern as other experimental API methods with proper RPC path, serializers, and parameter handling.

pyproject.toml (1)

3-3: LGTM! Appropriate version bump for new features.

The version bump to 1.13.0-rc1 correctly reflects a minor version increment with a release candidate designation, which is appropriate for introducing new Chainlink Data Streams oracle support.

pyinjective/proto/injective/oracle/v1beta1/genesis_pb2.py (1)

19-19: LGTM! Standard protobuf descriptor realignment.

The descriptor boundary adjustments are auto-generated changes that reflect upstream protobuf schema modifications. No functional changes to the public API.

Also applies to: 32-34

pyinjective/proto/google/iam/v1/policy_pb2_grpc.py (1)

1-4: LGTM! Standard generated gRPC stub boilerplate.

This is a new auto-generated gRPC Python stub file with the expected header. Part of the broader IAM v1 policy integration.

pyinjective/ofac.json (1)

36-36: LGTM! OFAC sanctioned address additions for compliance.

Three new addresses have been added to the OFAC sanctions list. All addresses are properly formatted in lowercase hexadecimal. These additions are important for maintaining regulatory compliance.

Also applies to: 62-62, 72-72

pyinjective/proto/injective/permissions/v1beta1/tx_pb2.py (1)

68-82: LGTM! Descriptor offset realignment from upstream proto changes.

The serialized offset adjustments reflect the upstream protobuf schema changes related to the namespace hook field updates (contract_hook → wasm_hook, addition of evm_hook). These are standard auto-generated changes with no functional impact.

buf.gen.yaml (1)

19-19: Clarify the cometbft downgrade and consider using v1.0.1-inj.5.

The downgrade from v1.0.1-inj.4 (released Oct 14) to v1.0.1-inj.3 (released Oct 13) needs justification. A newer version, v1.0.1-inj.5 (released Dec 16), is available. Provide:

  1. Reason for downgrading v1.0.1-inj.4 (critical bug, compatibility issue, etc.)
  2. Why v1.0.1-inj.5 was not chosen instead
  3. Confirmation that this downgrade doesn't reintroduce previously fixed issues
pyinjective/proto/injective/exchange/v1beta1/query_pb2.py (1)

239-239: Proto file auto-generated from upstream chain definitions—no action required for SDK.

This file is auto-generated from the Injective chain v1.18.0 proto definitions. Proto HTTP path annotations are metadata used by REST gateways, not by the SDK's gRPC-based client code. The SDK clients call gRPC methods by name (e.g., self._stub.SubaccountPositions), which remain stable. No breaking changes to SDK functionality.

Makefile (1)

29-29: Remove the unsupported Chainlink Data Streams support claim for v1.17.71.

The v1.17.71 tag exists in the injective-indexer repository; however, it introduces "filters to oracle list endpoint" and contains no Chainlink Data Streams references. Verify that this version aligns with the actual requirements of the PR rather than assuming Chainlink support based on the version bump.

Likely an incorrect or invalid review comment.

pyinjective/proto/injective/oracle/v1beta1/events_pb2.py (1)

1-64: Auto-generated protobuf code looks correct.

The new _EVENTSETCHAINLINKDATASTREAMSPRICES descriptor is properly added with sequential serialized offsets (1595-1713) following the existing _EVENTSETPYTHPRICES descriptor (1507-1593). The naming convention is consistent with other oracle event types.

pyinjective/proto/exchange/injective_oracle_rpc_pb2.py (1)

25-52: Auto-generated descriptor offset updates are consistent.

The serialized offset updates for all message descriptors follow the expected monotonically increasing pattern. These are standard metadata changes from protobuf regeneration.

pyinjective/proto/google/api/routing_pb2.py (1)

1-30: New Google API routing protobuf module follows standard generation patterns.

The file correctly implements the protobuf Python module structure with proper descriptor pool initialization, message/enum descriptor building, and conditional C-descriptor handling. The serialized offsets for RoutingRule and RoutingParameter are sequential.

pyinjective/proto/google/api/routing_pb2_grpc.py (1)

1-4: Minimal gRPC stub is expected.

The routing.proto file defines only message types (RoutingRule, RoutingParameter) without RPC services, so the generated gRPC module correctly contains only the import statement and docstring.

pyinjective/proto/exchange/event_provider_api_pb2.py (1)

42-76: Auto-generated descriptor offset updates are consistent.

The serialized offset updates maintain proper sequential ordering across all message descriptors. This is standard metadata adjustment from protobuf regeneration.

pyinjective/proto/exchange/injective_derivative_exchange_rpc_pb2.py (1)

98-178: Auto-generated descriptor offset updates are consistent.

All serialized offset updates for the derivative exchange RPC message descriptors maintain proper sequential ordering without overlaps. This is standard metadata from protobuf regeneration.

pyinjective/proto/injective/permissions/v1beta1/permissions_pb2.py (1)

19-48: Schema update for Namespace message correctly reflected.

The generated protobuf code properly reflects the schema changes:

  • Field renamed: contract_hookwasm_hook (field number 2)
  • New field added: evm_hook (field number 8)

The serialized descriptor and offset metadata are consistent with these schema changes.

pyinjective/proto/google/iam/v1/policy_pb2.py (2)

40-45: Shared enum offset range is intentional.

Lines 40-41 and 44-45 show _BINDINGDELTA_ACTION and _AUDITCONFIGDELTA_ACTION sharing the same serialized offset range (1012-1065). This is valid protobuf behavior when both enums have identical definitions (both define ACTION_UNSPECIFIED, ADD, REMOVE), allowing the compiler to deduplicate them in the serialized representation.


1-46: New Google IAM policy protobuf module follows standard generation patterns.

The file correctly implements the protobuf Python module structure with proper descriptor pool initialization, message/enum descriptor building, and conditional C-descriptor handling. All message types (Policy, Binding, AuditConfig, AuditLogConfig, PolicyDelta, BindingDelta, AuditConfigDelta) are properly defined with sequential offsets.

pyinjective/orderhash.py (1)

13-17: Approve the OrderInfo model migration to Pydantic BaseModel.

The migration from EIP712Type to Pydantic BaseModel with abi.string typed fields is clean and follows modern patterns for typed data structures.

pyinjective/composer.py (2)

1625-1650: API parameter rename: contract_hook → wasm_hook and new evm_hook.

The parameter rename from contract_hook to wasm_hook with the addition of evm_hook support is implemented correctly in msg_create_namespace. Ensure all callers have been updated to use the new parameter names.


1663-1664: No changes needed. The code correctly uses SetContractHook for both wasm_hook and evm_hook because the protobuf definition specifies that both fields have the same message type: MsgUpdateNamespace.SetContractHook. There is no separate SetEvmHook wrapper in the schema—the protobuf intentionally uses a single reusable wrapper type for both hooks.

pyinjective/proto/exchange/injective_archiver_rpc_pb2.py (1)

1-91: Generated protobuf file - no action required.

This is an auto-generated protobuf file with only internal descriptor offset adjustments. The changes are expected when regenerating protobuf definitions and do not require manual review.

tests/client/indexer/grpc/test_indexer_grpc_oracle_api.py (1)

37-37: Test updated to exercise oracle list filtering.

The test now correctly exercises the new optional symbol and oracle_type filtering parameters added to fetch_oracle_list. This aligns with the API changes across the client layers.

pyinjective/proto/google/iam/v1/options_pb2_grpc.py (1)

1-4: Generated gRPC stub file - placeholder.

This is an auto-generated gRPC stub file that currently only contains the module header and import. It appears to be a scaffold added as part of IAM v1 integration. No action required for generated code.

examples/exchange_client/oracle_rpc/3_OracleList.py (1)

12-12: Example updated to demonstrate oracle list filtering.

The example now demonstrates the new optional filtering capability with symbol="TIA" and oracle_type="provider". This provides users with a clear example of how to use the enhanced API.

tests/client/indexer/grpc/test_indexer_grpc_portfolio_api.py (1)

52-53: Test updated for new funding entry fields.

The test correctly includes and validates the new cumulative_funding_entry and effective_cumulative_funding_entry fields added to the DerivativePosition message. The test data and assertions are consistent.

Also applies to: 115-116

examples/chain_client/permissions/2_MsgUpdateNamespace.py (1)

75-84: Example updated for wasm_hook/evm_hook API changes.

The example correctly demonstrates the renamed wasm_hook parameter (previously contract_hook) and the new optional evm_hook parameter. The empty string for evm_hook shows users it can be left empty when not needed.

examples/chain_client/permissions/1_MsgCreateNamespace.py (1)

91-101: Example correctly updated for wasm_hook / evm_hook API

The example now uses the new wasm_hook and evm_hook parameters in msg_create_namespace, aligned with the updated Composer signature; using empty strings as “no hook” values is consistent and non‑breaking.

pyinjective/indexer_client.py (1)

662-665: Oracle list filters correctly propagated in IndexerClient

fetch_oracle_list now exposes symbol and oracle_type and cleanly forwards them to oracle_api.fetch_oracle_list, consistent with the rest of the indexer client wrapper methods.

pyinjective/async_client.py (1)

1297-1300: AsyncClient wrapper for oracle list matches indexer client

The new fetch_oracle_list method correctly mirrors the IndexerClient signature and simply forwards symbol and oracle_type, which is consistent with other AsyncClient pass‑through methods.

pyinjective/proto/injective/permissions/v1beta1/params_pb2.py (1)

21-32: Params proto regeneration for contract_hook_max_gas looks consistent

The DESCRIPTOR blob and _PARAMS metadata reflect the renamed contract_hook_max_gas field and updated layout; this appears to be standard protoc output with no manual logic to review.

pyinjective/proto/injective/exchange/v2/market_pb2.py (1)

17-21: Market proto regeneration with new TWAP cumulative fields looks correct

The regenerated market_pb2 adds the expected TWAP cumulative price fields to ExpiryFuturesMarketInfo and updates the associated LegacyDec field options and descriptor offsets; given this is protoc‑generated metadata, it looks consistent with an updated .proto schema.

Also applies to: 104-151

tests/test_composer_v2.py (1)

1775-1911: Namespace hook tests accurately cover wasm_hook and evm_hook semantics

The updated namespace tests now validate both creation (namespace.wasmHook / namespace.evmHook as plain strings) and update (wasmHook / evmHook wrapped in newValue patch objects), which matches the expected JSON shape from the new proto fields and Composer API.

Also applies to: 1913-2033

pyinjective/proto/google/iam/v1/options_pb2.py (1)

1-27: New google.iam.v1 GetPolicyOptions proto module is standard and safe

This file is standard generated code for GetPolicyOptions (with requested_policy_version) and follows the usual protobuf pattern; there’s no hand‑written logic and nothing problematic from a consumer perspective.

pyinjective/composer_v2.py (1)

1694-1715: Namespace wasm/evm hooks wiring looks consistent.

The additions of wasm_hook and evm_hook to msg_create_namespace and msg_update_namespace correctly populate the new Namespace fields and the update wrapper messages, and they align with the updated tests (JSON wasmHook/evmHook expectations).

Also applies to: 1721-1744

tests/client/indexer/stream_grpc/test_indexer_grpc_derivative_stream.py (1)

325-342: New cumulative funding fields in streamed positions are wired correctly.

For both DerivativePosition and DerivativePositionV2, the tests now initialize cumulative_funding_entry / effective_cumulative_funding_entry and assert the corresponding JSON keys cumulativeFundingEntry / effectiveCumulativeFundingEntry. The expectations match the proto field names and existing funding fields.

Also applies to: 370-387, 810-826, 857-873

tests/client/chain/grpc/test_chain_grpc_permissions_api.py (2)

27-39: Module params rename to contractHookMaxGas is consistent.

Tests now build Params(contract_hook_max_gas=...) and expect contractHookMaxGas in JSON for both direct params and module state. This matches the typical camelCase conversion of the new proto field.

Also applies to: 466-469, 520-525


89-99: Permissions namespace wasmHook/evmHook expectations are coherent.

The namespace fixtures now set wasm_hook and evm_hook, and all related expectations (fetch_namespaces, fetch_namespace, and fetch_permissions_module_state) assert wasmHook and evmHook in the JSON output. This matches the updated namespace schema and the composer tests.

Also applies to: 105-151, 181-191, 197-241, 493-503, 528-565

tests/test_composer.py (2)

1587-1651: Create-namespace test correctly covers new wasm/evm hooks.

test_msg_create_namespace now passes both wasm_hook and evm_hook to msg_create_namespace and asserts that the serialized namespace has wasmHook and evmHook populated with the same values alongside existing role/policy fields. This gives good coverage of the new hook fields.

Also applies to: 1653-1717


1727-1781: Update-namespace test validates hook update wrapper messages.

test_msg_update_namespace asserts that wasmHook and evmHook in the update message are objects with a newValue field carrying the passed hooks. This matches the SetContractHook-style wrapper used in the composer and provides solid regression coverage for future schema changes.

Also applies to: 1783-1840

pyinjective/proto/injective/oracle/v1beta1/query_pb2_grpc.py (1)

68-72: Chainlink Data Streams RPC is wired consistently across client and server stubs.

The new ChainlinkDataStreamsPriceStates method is correctly added to the stub, servicer, server registration, and experimental Query static API, all using the matching request/response types and the expected RPC path. This looks ready for server-side implementation.

Also applies to: 184-190, 289-293, 611-637

tests/client/indexer/grpc/test_indexer_grpc_derivative_api.py (1)

625-642: Additional funding-entry fields are correctly propagated in derivative position APIs.

The tests for fetch_positions, fetch_positions_v2, and fetch_liquidable_positions now include cumulative_funding_entry and effective_cumulative_funding_entry in fixtures and assert the matching camelCase keys in the JSON output. This aligns with the extended proto schema and ensures the new data is exposed in all relevant endpoints.

Also applies to: 668-687, 705-721, 747-765, 783-800, 815-834

tests/client/chain/grpc/test_chain_grpc_exchange_v2_api.py (2)

465-498: LGTM!

The has_disabled_minimal_protocol_fee field is correctly added to the SpotMarket test data and expectation. The pattern is consistent across all market types.


1784-1806: LGTM!

The new expiration_twap_start_base_cumulative_price and expiration_twap_start_quote_cumulative_price fields are correctly added to both the test input and expected output, with proper camelCase naming in the serialized form.

pyinjective/proto/injective/oracle/v1beta1/query_pb2.py (1)

65-66: LGTM!

The new ChainlinkDataStreamsPriceStates RPC is correctly added with proper HTTP annotation (/injective/oracle/v1beta1/chainlink_data_stream_price_states) and the request/response message descriptors are properly registered. This aligns with the PR objective of adding Chainlink Data Streams oracle support.

Also applies to: 125-128

pyinjective/proto/google/iam/v1/iam_policy_pb2_grpc.py (2)

88-118: Static analysis hints are false positives for generated servicer stubs.

The unused request arguments flagged by Ruff (lines 88, 98, 107) are expected in gRPC servicer base classes. These methods are intentionally unimplemented stubs that define the interface contract - they're meant to be overridden in subclasses where request will be used.


121-142: LGTM!

The add_IAMPolicyServicer_to_server function correctly registers all three RPC method handlers with appropriate request deserializers and response serializers. This follows standard gRPC Python patterns.

pyinjective/proto/google/iam/v1/iam_policy_pb2.py (1)

19-20: These import paths are correct and intentional. The generated protobuf files properly distinguish between locally vendored protos (pyinjective.proto.google.api.*) and Google's standard packages (google.iam.v1.*, google.type.*, google.protobuf.*). This pattern is consistent with how protoc generates files and is not an error. The google namespace package allows direct imports of Google packages to coexist without conflicts.

Likely an incorrect or invalid review comment.

pyinjective/proto/exchange/injective_portfolio_rpc_pb2.py (1)

17-58: New cumulative funding fields on DerivativePosition look protobuf‑compatible

DerivativePosition now includes cumulative_funding_entry and effective_cumulative_funding_entry, appended at the end of the message, with the rest of the change being descriptor offset realignment. That’s a backward‑compatible protobuf extension and matches existing decimal‑as‑string patterns used elsewhere in the schema.

pyinjective/proto/injective/exchange/v2/query_pb2.py (1)

24-247: REST endpoint paths for positions queries have changed; verify client impact

Query.PositionsInMarket and Query.SubaccountPositions now map to /injective/exchange/v2/positions_in_market/{market_id} and /injective/exchange/v2/subaccount_positions/{subaccount_id} respectively (previously under the generic /positions/... paths). gRPC wire compatibility is preserved, but any REST/grpc‑gateway clients hard‑coding the old URLs will break and must be updated together with documentation and examples.

pyinjective/proto/exchange/injective_auction_rpc_pb2.py (1)

17-80: AuctionAccountStatus RPC and messages are wired consistently

AuctionAccountStatusRequest/Response and the InjectiveAuctionRPC.AuctionAccountStatus RPC are added in the descriptor with consistent naming and message usage; the rest is start/end offset shuffling. This is a clean additive API surface, with the usual requirement that servers implement the new RPC rather than leaving the default UNIMPLEMENTED stub.

pyinjective/proto/injective/exchange/v1beta1/exchange_pb2.py (1)

21-438: OpenNotionalCap option updates are metadata‑only and safe

The only semantic change is that OpenNotionalCap.uncapped/capped now carry explicit OpenNotionalCapUncapped/OpenNotionalCapCapped type options; all other edits are _serialized_start/_serialized_end realignments. This does not affect protobuf wire format and should be transparent to existing clients.

pyinjective/proto/injective/oracle/v1beta1/oracle_pb2.py (1)

20-129: Chainlink Data Streams oracle extensions are added in a wire‑compatible way

Params now exposes Chainlink Data Streams config (verifier proxy, acceptance flag, gas limit), ChainlinkDataStreamsPriceState is added, and OracleType gains a ChainlinkDataStreams variant, with price_state options matching other price‑state messages. All additions are backward‑compatible (new fields and a new enum value at the tail), and they align with the goal of integrating Chainlink Data Streams oracle prices.

pyinjective/proto/exchange/injective_megavault_rpc_pb2.py (1)

17-96: Megavault descriptor updates are purely structural

The _USER_HISTORICALPNL descriptor indices are re‑based and _OPERATIONSTATUSLOGENTRY now has explicit _serialized_start/_serialized_end entries. Message and RPC schemas themselves are unchanged, so this is effectively a no‑risk regeneration of the megavault proto bindings.

pyinjective/proto/exchange/injective_auction_rpc_pb2_grpc.py (1)

43-352: AuctionAccountStatus gRPC wiring is consistent; ignore the unused-arg lint on the base servicer

The new AuctionAccountStatus RPC is correctly added to:

  • the client stub,
  • the servicer interface,
  • server registration, and
  • the EXPERIMENTAL static client, all using the same path and request/response types as in the proto.

The Ruff ARG002 on the request argument in InjectiveAuctionRPCServicer.AuctionAccountStatus is expected for an unimplemented base method; concrete servicer implementations will consume request, so no change is needed here.

pyinjective/proto/injective/exchange/v2/proposal_pb2.py (1)

26-249: Tri‑state minimal‑protocol‑fee flag is added consistently across proposal types

DisableMinimalProtocolFeeUpdate (NoUpdate/False/True) plus the has_disabled_minimal_protocol_fee field on spot, derivative, and binary‑options param‑update proposals give you a proper tri‑state “no change / explicitly disable / explicitly enable” control for the minimal protocol fee. The new enum and fields are added in a protobuf‑compatible way and wired consistently via field options and descriptor indices; any client logic consuming these proposals just needs to honor the tri‑state semantics correctly.

Comment on lines +32 to 33
branch: c-655/add_chainlink_data_streams_oracle
subdir: proto
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Critical: Replace branch reference with tagged release or commit SHA.

Using a feature branch (c-655/add_chainlink_data_streams_oracle) for the injective-core dependency is problematic because:

  • Branch references are mutable and can change unexpectedly
  • This breaks build reproducibility
  • Not suitable for production or release candidates
  • Makes debugging and auditing difficult
🔎 Recommended fix

Use either:

  1. A tagged release once the branch is merged (preferred):
  - git_repo: https://github.com/InjectiveLabs/injective-core
-   branch: c-655/add_chainlink_data_streams_oracle
+   tag: v1.18.0  # or appropriate version
    subdir: proto
  1. A specific commit SHA for immutability:
  - git_repo: https://github.com/InjectiveLabs/injective-core
-   branch: c-655/add_chainlink_data_streams_oracle
+   commit: <full-40-char-sha>
    subdir: proto

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In buf.gen.yaml around lines 32–33, the dependency currently points to a mutable
branch (c-655/add_chainlink_data_streams_oracle); replace this with an immutable
reference by using either a released tag (preferred) or a specific commit SHA
for the injective-core dependency. Update the branch field to the chosen
immutable identifier (tag or commit SHA), regenerate any buf/lock/CI artifacts
(run your buf/bazel/npm regen or lockfile update steps) and verify builds to
ensure reproducibility.

Comment on lines +21 to +27
eip712_domain = EIP712Domain(
name="Injective Protocol",
version="2.0.0",
chainId=888,
verifyingContract="0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC",
salt=HexBytes("0x0000000000000000000000000000000000000000000000000000000000000000"),
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for chainId references
echo "=== Searching for chainId references ==="
rg -n "chainId" --type py -C 2

echo ""
echo "=== Searching for verifyingContract references ==="
rg -n "verifyingContract" --type py -C 2

echo ""
echo "=== Searching for EIP712Domain usage ==="
rg -n "EIP712Domain" --type py -C 3

echo ""
echo "=== Searching for network or environment configuration ==="
rg -n "MAINNET|TESTNET|DEVNET|network" --type py | head -30

echo ""
echo "=== Checking orderhash.py file context ==="
cat -n pyinjective/orderhash.py | head -60

Repository: InjectiveLabs/sdk-python

Length of output: 11373


🏁 Script executed:

#!/bin/bash
# Check the build_eip712_msg function and how it uses the network parameter
echo "=== Checking build_eip712_msg function ==="
sed -n '70,120p' pyinjective/orderhash.py

echo ""
echo "=== Check if there are any related issues or TODOs ==="
rg -n "TODO|FIXME|XXX|HACK" pyinjective/orderhash.py -C 2

echo ""
echo "=== Check for any test files related to orderhash ==="
fd -e py "orderhash" tests/

echo ""
echo "=== Check if chainId=888 appears in tests ==="
rg -n "888" --type py | grep -E "(test_|orderhash)" | head -20

Repository: InjectiveLabs/sdk-python

Length of output: 3024


🏁 Script executed:

#!/bin/bash
# Check the test_orderhash.py file
echo "=== Full test_orderhash.py file ==="
cat -n tests/test_orderhash.py

echo ""
echo "=== Check Network class to see what chain IDs are available ==="
rg -n "class Network" pyinjective/core/ -A 20 | head -80

echo ""
echo "=== Check if there's documentation about chainId=888 ==="
fd -e md -e txt -e rst . | xargs grep -l "888\|chainId" 2>/dev/null | head -10

Repository: InjectiveLabs/sdk-python

Length of output: 4246


🏁 Script executed:

#!/bin/bash
# Get the chain_id values used in Network class
echo "=== Check Network devnet chain_id ==="
rg -n "devnet\|testnet\|mainnet" pyinjective/core/network.py -A 5 | head -100

echo ""
echo "=== Look for static Network factory methods ==="
rg -n "def devnet|def testnet|def mainnet" pyinjective/core/network.py -A 10 | head -100

echo ""
echo "=== Check what chain_id value is used in Network initialization ==="
rg -n "chain_id.*=" pyinjective/core/network.py | head -20

Repository: InjectiveLabs/sdk-python

Length of output: 2033


🏁 Script executed:

#!/bin/bash
# Let's verify the numeric chain IDs and understand the pattern
echo "=== Summary of chain_ids ==="
grep -n "chain_id=" pyinjective/core/network.py | grep -E "(devnet|testnet|mainnet)"

echo ""
echo "=== Check if chainId in EIP712Domain should be numeric or string ==="
rg -n "chainId" --type py -B 2 -A 2

echo ""
echo "=== Verify that network parameter is passed but not used in orderhash ==="
sed -n '58,85p' pyinjective/orderhash.py

Repository: InjectiveLabs/sdk-python

Length of output: 5583


🏁 Script executed:

#!/bin/bash
# Extract numeric chain IDs from network definitions
echo "=== Extract numeric chain IDs from network string values ==="
grep "chain_id=" pyinjective/core/network.py | grep -E "injective-[0-9]" | sed 's/.*injective-//' | sed 's/".*//'

echo ""
echo "=== Verify the relationship between string chain_ids and numeric chainId ==="
echo "devnet: chain_id='injective-777' -> numeric chainId should be 777"
echo "testnet: chain_id='injective-888' -> numeric chainId should be 888"
echo "mainnet: chain_id='injective-1' -> numeric chainId should be 1"
echo ""
echo "Current hardcoded value in orderhash.py: chainId=888 (testnet only)"

echo ""
echo "=== Check if network parameter contains chain_id information ==="
grep -n "self.chain_id" pyinjective/core/network.py | head -5
</parameter>

Repository: InjectiveLabs/sdk-python

Length of output: 713


🏁 Script executed:

#!/bin/bash
# Confirm the issue: network parameter has chain_id but it's not used in orderhash
echo "=== Check if OrderHashManager stores network for later use ==="
sed -n '65,105p' pyinjective/orderhash.py

echo ""
echo "=== Confirm that network.chain_id is available but not used ==="
echo "Network object has chain_id attribute (line 132 in network.py)"
echo "But build_eip712_msg function doesn't accept or use network parameter"

grep -n "def build_eip712_msg" pyinjective/orderhash.py -A 15

Repository: InjectiveLabs/sdk-python

Length of output: 2487


Make EIP712 domain configuration network-aware instead of hardcoded.

The chainId=888 in the EIP712Domain is hardcoded to testnet, but the SDK supports multiple networks (devnet with chain_id="injective-777", testnet with chain_id="injective-888", mainnet with chain_id="injective-1"). The network parameter passed to OrderHashManager contains the correct chain ID but is never stored or used—it's only used to fetch endpoint URLs. This causes orders hashed on devnet or mainnet to have incorrect EIP712 domain values. Extract the numeric chain ID from the network parameter and pass it to the EIP712Domain construction.

🤖 Prompt for AI Agents
In pyinjective/orderhash.py around lines 21 to 27, the EIP712Domain is using a
hardcoded chainId=888; instead, store the incoming network parameter on the
OrderHashManager instance and derive the numeric chain ID from it (e.g., parse
digits from "injective-777"/"injective-888"/"injective-1" or use a
network.chain_id property if present) and pass that numeric value into
EIP712Domain.chainId so the domain matches devnet/testnet/mainnet.

Comment on lines +5 to +6
from google.iam.v1 import iam_policy_pb2 as google_dot_iam_dot_v1_dot_iam__policy__pb2
from google.iam.v1 import policy_pb2 as google_dot_iam_dot_v1_dot_policy__pb2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

# Check if vendored policy_pb2.py exists at the expected location
echo "=== Checking for vendored policy_pb2.py ==="
fd -t f "policy_pb2.py" pyinjective/proto/google/iam/v1/

# Check project dependencies for google-iam packages
echo -e "\n=== Checking project dependencies ==="
fd -t f "(requirements|setup|pyproject)" . | head -5 | while read f; do
  echo "--- File: $f ---"
  cat "$f" 2>/dev/null | rg -i "google.*iam|grpc.*iam" || echo "(no matches)"
done

Repository: InjectiveLabs/sdk-python

Length of output: 290


🏁 Script executed:

#!/bin/bash

# Look at the actual imports in the target file
echo "=== Imports in iam_policy_pb2_grpc.py (lines 1-20) ==="
head -20 pyinjective/proto/google/iam/v1/iam_policy_pb2_grpc.py

# Look at the corresponding pb2 file
echo -e "\n=== Imports in iam_policy_pb2.py (lines 1-20) ==="
head -20 pyinjective/proto/google/iam/v1/iam_policy_pb2.py

# Check if policy_pb2.py exists
echo -e "\n=== Checking for policy_pb2.py files ==="
find pyinjective/proto -name "policy_pb2.py" -type f

Repository: InjectiveLabs/sdk-python

Length of output: 2041


🏁 Script executed:

#!/bin/bash

# Examine broader import patterns in the proto directory
echo "=== Sample imports from other proto files in the same location ==="
fd -t f "\.py$" pyinjective/proto/google/iam/v1/ | head -5 | while read f; do
  echo "--- File: $(basename $f) ---"
  head -15 "$f" | rg "^from|^import" || true
done

# Check the general structure of vendored proto imports
echo -e "\n=== Sample imports from other google proto directories ==="
fd -t f "\.py$" pyinjective/proto/google/api/ | head -3 | while read f; do
  echo "--- File: $(basename $f) ---"
  head -15 "$f" | rg "^from|^import" || true
done

Repository: InjectiveLabs/sdk-python

Length of output: 2192


Inconsistent import paths - these should use vendored modules if available locally.

The gRPC stub file imports from google.iam.v1 directly, but policy_pb2.py and iam_policy_pb2.py are vendored locally at pyinjective/proto/google/iam/v1/. The corresponding pb2 file inconsistently uses vendored paths for google.api.* modules while importing google.iam.v1.* from external packages.

Since both files are generated (marked "DO NOT EDIT"), the imports need to be corrected at generation time. Regenerate using protoc configuration that consistently uses vendored import paths:

from pyinjective.proto.google.iam.v1 import iam_policy_pb2 as ...
from pyinjective.proto.google.iam.v1 import policy_pb2 as ...
🤖 Prompt for AI Agents
In pyinjective/proto/google/iam/v1/iam_policy_pb2_grpc.py around lines 5 to 6,
the file imports google.iam.v1 modules from the external package instead of the
vendored local protobufs; regenerate or reconfigure protoc to use the local
vendored import paths so the lines become imports from
pyinjective.proto.google.iam.v1 (e.g., update protoc --proto_path and/or
python_out/import_prefix settings or the generation plugin options) ensuring
both iam_policy_pb2 and policy_pb2 are referenced via
pyinjective.proto.google.iam.v1 to match the vendored pb2 files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants